﻿/**
 * Copyright (C) 2011 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGuice.Inject.Spi
{
    //complete!
    /// <summary>
    /// 访问元素的访问者
    /// </summary>
    /// <typeparam name="V">被访问方法返回的任意类型</typeparam>
    public interface IElementVisitor<V>
    {

        /// <summary>
        /// 从一个key中添加一个映射到获取类型实例的策略中
        /// </summary>
        V Visit<T>(IBinding<T> binding);

        /*if[AOP]*/
        /// <summary>
        /// 访问一个注册的匹配类的匹配方法的拦截器
        /// </summary>
        /// <param name="binding"></param>
        /// <returns></returns>
        V Visit(InterceptorBinding binding);
        /*end[AOP]*/

        /// <summary>
        /// 访问scope元特性的注册
        /// </summary>
        V Visit(ScopeBinding binding);

        /// <summary>
        /// 访问匹配目标类型的类型转换注册
        /// </summary>
        V Visit(TypeConverterBinding binding);

        /// <summary>
        /// 访问一个实例的域和方法注入请求
        /// </summary>
        V Visit(InjectionRequest request);

        /// <summary>
        /// 访问一个类型的静态域或方法的注入请求
        /// </summary>
        V Visit(StaticInjectionRequest request);

        /// <summary>
        /// 为一个类型访问提供者lookup
        /// </summary>
        V Visit<T>(ProviderLookup<T> lookup);

        /// <summary>
        /// 访问成员注入器的lookup
        /// </summary>
        V Visit<T>(MembersInjectorLookup<T> lookup);

        /// <summary>
        /// 访问一个发生的错误消息和上下文
        /// </summary>
        V Visit(Message message);

        /// <summary>
        /// 为PrivateBinder私有绑定器访问配置元素集合
        /// </summary>
        V Visit(IPrivateElements elements);

        /// <summary>
        /// 访问一个可注入类型的监听器绑定
        /// </summary>
        V Visit(TypeListenerBinding binding);

        /// <summary>
        /// 访问一个请求的显式绑定命令
        /// </summary>
        V Visit(RequireExplicitBindingsOption option);

        /// <summary>
        /// 访问一个disable的循环代理命令
        /// </summary>
        V Visit(DisableCircularProxiesOption option);
    }
}
